import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { OrderComponent } from './pages/order/order.component';
import { OrderDetailComponent } from './pages/order-detail/order-detail.component';
import { SealingComponent } from './pages/sealing/sealing.component';
import { LibraryDetailComponent } from './pages/library-detail/library-detail.component';
import { LibraryComponent } from './pages/library/library.component';
import { QrcodeComponent } from './pages/qrcode/qrcode.component';
import { MovelibraryComponent } from './pages/movelibrary/movelibrary.component';
import { MovelibraryDetailComponent } from './pages/movelibrary-detail/movelibrary-detail.component';
import { MoveqrcodeComponent } from './pages/moveqrcode/moveqrcode.component';

const routes: Routes = [
    {
        path: 'pickorder',
        component: OrderComponent,
        data: { breadcrumbs: [{ title: '拣货单信息' }] },
        children: [
            {
                path: 'detail/:id',
                component: OrderDetailComponent,
                data: { breadcrumbs: [{ title: '拣货单列表', path: '/pickorder/pickorder' }, { title: '拣货单详情' }] },
                children: [
                    {
                        path: 'add',
                        component: SealingComponent,
                        data: { breadcrumbs: [{ title: '拣货单详情', path: '/pickorder/pickorder' }, { title: '封箱条打印' }] }
                    },
                ]
            },
            {
                path: 'detail',
                component: OrderDetailComponent,
                data: { breadcrumbs: [{ title: '拣货单列表', path: '/pickorder/pickorder' }, { title: '添加拣货单' }] },
            },
        ]
    },
    {
        path: 'library',
        component: LibraryComponent,
        children: [
            {
                path: 'detail', component: LibraryDetailComponent, data: {
                    breadcrumbs: [{ title: '余额列表', path: '/inventory/price' }, { title: '添加余额' }]
                },
                children: [
                    {
                        path: 'qrcode',
                        component: QrcodeComponent,
                        data: { breadcrumbs: [{ title: '拣货单详情', path: '/pickorder/pickorder' }, { title: '封箱条打印' }] }
                    },
                ]
            },
            {
                path: 'detail/:id', component: LibraryDetailComponent, data: {
                    breadcrumbs: [{ title: '余额列表', path: '/inventory/price' }, { title: '余额详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '余额列表' }]
        }
    },
    {
        path: 'movelibrary',
        component: MovelibraryComponent,
        children: [
            {
                path: 'detail', component: MovelibraryDetailComponent, data: {
                    breadcrumbs: [{ title: '余额列表', path: '/inventory/price' }, { title: '添加余额' }]
                },
                children: [
                    {
                        path: 'moveqrcode',
                        component: MoveqrcodeComponent,
                        data: { breadcrumbs: [{ title: '拣货单详情', path: '/pickorder/pickorder' }, { title: '封箱条打印' }] }
                    },
                ]
            },
            {
                path: 'detail/:id', component: MovelibraryDetailComponent, data: {
                    breadcrumbs: [{ title: '余额列表', path: '/inventory/price' }, { title: '余额详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '余额列表' }]
        }
    },
];

export const declarationComponents = [
    OrderComponent,
    OrderDetailComponent,
    SealingComponent,
    LibraryComponent,
    LibraryDetailComponent,
    QrcodeComponent,
    MovelibraryComponent,
    MovelibraryDetailComponent,
    MoveqrcodeComponent
];

export const entryComponents = [
];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [
        RouterModule
    ]
})
export class PickorderRoutingModule { }
